package com.example.workapp;

import android.content.Intent;
import android.os.Bundle;
import android.widget.Button;

import androidx.activity.EdgeToEdge;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;

public class EditFileActivity extends AppCompatActivity {
//    private static final String bluetoothAddress = "B4:A5:AC:D6:E4:4C";  // 示例蓝牙地址
    private static final String TARGET_DEVICE_MAC_ADDRESS = "36:ea:8c:81:9e:c9";  // mac地址
    private Button btnSend;
    private Button btnRec;
    private int flag = 1;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        EdgeToEdge.enable(this);
        setContentView(R.layout.activity_edit_file);
        btnSend = findViewById(R.id.btnSend);
        btnRec = findViewById(R.id.btnRec);
        btnSend.setOnClickListener(v -> send());
        btnRec.setOnClickListener(v -> rec());
    }
    private void send() {
        // Start Wi-Fi Direct transfer activity
        System.out.println("进入wifi-direct");
        Intent intent = new Intent(this, WiFiActivity.class);
        intent.putExtra("flag", flag);
        intent.putExtra("TARGET_DEVICE_MAC_ADDRESS", TARGET_DEVICE_MAC_ADDRESS);
        startActivity(intent);

    }
    private void rec(){
        Intent intent = new Intent(this,WifiClientActivity.class);
        intent.putExtra("flag", flag);
        startActivity(intent);
    }
}